package com.example.xd.javatest.jvm_test;

import java.util.ArrayList;

/**
 * @auther XuDan on 2020/6/17.
 */
public class JconsonleTest {
    public byte[] b = new byte[128 * 1024];

    public static void main(String[] args) {
        try {
            Thread.sleep(15000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
//        test();
        method_test();
    }

    private static void method_test() {
        for (int i = 0; i < 10; i++) {
            new Thread(new Runnable() {
                @Override
                public void run() {
                    System.out.println(Thread.currentThread().getId() + "---" + Thread.currentThread().getName());
                }
            }).start();
        }
    }

    private static void test() {
        ArrayList<JconsonleTest> integers = new ArrayList<>();
        for (int i = 0; i < 1000; i++) {
            try {
                Thread.sleep(100);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            integers.add(new JconsonleTest());
        }
    }
}
